//
//  MHCategoryCell.m
//  ManHua
//
//  Created by 赵永泉 on 15/10/29.
//  Copyright © 2015年 蓝欧科技. All rights reserved.
//

#import "MHCategoryCell.h"
#import "MHCategoryDetailViewController.h"

@interface MHCategoryCell ()
@property (nonatomic, strong) MHCategoryDetailViewController *detailVC;

@end

@implementation MHCategoryCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.detailVC = [[MHCategoryDetailViewController alloc] initWithCollectionViewLayout:[[UICollectionViewFlowLayout alloc]init]];
        self.detailVC.collectionView.frame = self.contentView.bounds;
        [self.contentView addSubview:self.detailVC.collectionView];
    }
    return self;
}

- (void)setCatalogID:(NSInteger)CatalogID
{
    _CatalogID = CatalogID;
    self.detailVC.CatalogID = CatalogID;
}

- (void)setPushComicDetailVCBlock:(PushComicDetailVCBlock)pushComicDetailVCBlock
{
    _pushComicDetailVCBlock = pushComicDetailVCBlock;
    __weak MHCategoryCell *test = self;
    self.detailVC.pushComicDetailVCBlock = ^(MHComicIntroduct *comicIntroduct)
    {
        if (test.pushComicDetailVCBlock != nil) {
            test.pushComicDetailVCBlock(comicIntroduct);
        }
    };
}

@end
